Most USB transactions use three packet types to complete a transfer:
- Token Packet — Identifies the target and direction
- Data Packet — Carries the payload
- Handshake Packet — Confirms success or signals an error
Exception: Isochronous transfers use only Token and Data packets — no handshake, no retransmission.
Transaction Sequence
IN Transaction (Device → Host)
Host ──── IN Token ────────► Device
Host ◄─── Data Packet ────── Device
Host ──── ACK ─────────────► Device
The host requests data; the device responds with a data packet; the host acknowledges.
OUT Transaction (Host → Device)
Host ──── OUT Token ───────► Device
Host ──── Data Packet ─────► Device
Host ◄─── ACK ──────────── Device
The host announces a write, sends the data, and the device confirms receipt.
SETUP Transaction (Host → Device, Control Only)
Host ──── SETUP Token ─────► Device
Host ──── DATA0 (8 bytes) ──► Device
Host ◄─── ACK ──────────── Device
Always uses DATA0 PID. The device must accept the setup packet (it cannot NAK a SETUP).
Packet Types in Detail
Token Packet
Sent only by the host to begin every transaction.
| Field | Size | Description |
|---|---|---|
| PID | 8 bits | Packet type: IN (0x69), OUT (0xE1), SETUP (0x2D) |
| ADDR | 7 bits | Target device address (0–127) |
| ENDP | 4 bits | Target endpoint number (0–15) |
| CRC5 | 5 bits | Error check over ADDR + ENDP fields |
Total size: 3 bytes (including PID)
Data Packet
Contains the actual payload. Can be sent by either host or device depending on direction.
| Field | Size | Description |
|---|---|---|
| PID | 8 bits | DATA0 (0xC3), DATA1 (0x4B), DATA2 (0x87), MDATA (0x0F) |
| Data | 0–1024 bytes | Payload (size ≤ endpoint's wMaxPacketSize) |
| CRC16 | 16 bits | Error check over the entire data field |
Data Toggle (DATA0 / DATA1)
USB uses alternating PIDs as a synchronization mechanism:
Transaction 1: DATA0 ──► (ACK) ──► toggle
Transaction 2: DATA1 ──► (ACK) ──► toggle
Transaction 3: DATA0 ──► (ACK) ──► toggle
...
- Both sender and receiver maintain a toggle bit
- If the receiver gets a packet with the wrong PID, it knows the previous ACK was lost — it re-ACKs but discards the duplicate data
- If the receiver gets a packet with the correct PID, it accepts the data and flips its toggle
- SETUP transactions always reset the toggle to DATA0
DATA2 and MDATA are used only in high-speed, high-bandwidth isochronous transfers (multiple transactions per microframe).
Handshake Packet
The simplest packet — just a PID, no payload, no CRC.
| PID | Sent By | Meaning |
|---|---|---|
| ACK | Host or Device | Data received successfully |
| NAK | Device only | Endpoint temporarily unable to send/receive (busy) |
| STALL | Device only | Endpoint is halted or request is unsupported |
| NYET | Device only (HS) | Data accepted, but not ready for next (see Ping Protocol) |
Total size: 1 byte (PID only)
Packet Elements

| Element | Description |
|---|---|
| SOP (Start of Packet) | Receiver synchronization sequence |
| PID (Packet Identifier) | Indicates packet type and format |
| Device Address / EP Number | Identifies the peripheral target (token packets) |
| Data Payload | 0–1024 bytes; varies with endpoint type and speed |
| CRC | 5 bits for token packets; 16 bits for data packets |
| EOP (End of Packet) | Indicates pending return to idle and position of CRC |
IN Transaction — All Possible Outcomes

Device endpoint to Host Controller
| Device Response | Meaning | Host Action |
|---|---|---|
| DATA0/1 → Host ACKs | Data successfully received | Accept data; toggle |
| NAK | Endpoint has no data ready | Retry in next scheduled opportunity |
| STALL | Endpoint is halted | Report error to software; endpoint needs CLEAR_FEATURE(ENDPOINT_HALT) |
| No response (timeout) | Device error or disconnected | Retry (up to 3 times), then report error |
OUT Transaction — All Possible Outcomes

Host to device.
| Device Response | Meaning | Host Action |
|---|---|---|
| ACK | Data received successfully | Send next packet; toggle |
| NAK | Endpoint buffer full | Retry later (or use Ping Protocol at HS) |
| NYET (HS only) | Data accepted, but not ready for next | Switch to Ping before next OUT |
| STALL | Endpoint halted | Report error to software |
| No response (timeout) | Device error or disconnected | Retry (up to 3 times), then report error |
Low-Speed Transaction Variation

Low-speed devices (1.5 Mbps) require special handling when behind a full-speed hub:
- Host sends a PRE (Preamble) PID at full speed
- Hub enables its low-speed repeater on the target port
- Host sends the low-speed token and data packets
- Hub disables the low-speed repeater after EOP
The PRE mechanism is only needed between the host and a full-speed hub. High-speed hubs use split transactions instead.
Control Transfer Stages
Control transfers use the Token–Data–Handshake protocol across two or three stages:
Stage Breakdown
| Stage | Required? | Description |
|---|---|---|
| Setup Stage | Always | Single transaction (special OUT variant with SETUP PID); always includes an 8-byte data packet containing request information |
| Data Stage | Optional | One or more IN or OUT transactions for moving data between host and device; omitted when no data transfer is needed |
| Status Stage | Always | Single IN or OUT transaction with a 0-byte payload; confirms successful completion |
Three-Stage Control Transfer (with data)
.png)
The data stage is included in a three-stage control transfer. The data stage can consist of:
- Single transaction — if the data fits within the endpoint's max packet size (up to 64 bytes)
- Multiple transactions — for larger data transfers (up to 64 KB total)
Example: GET_DESCRIPTOR — SETUP stage sends the request, DATA stage returns the descriptor (may take multiple 64-byte transactions), STATUS stage confirms.
Two-Stage Control Transfer (no data)

These transfers omit the data stage because the command or information is incorporated into the Setup packet itself.
Example: SET_ADDRESS — The 7-bit address is included inside the 8-byte data payload of the setup transaction; STATUS stage confirms acceptance.
Maximum Payload Sizes (USB 2.0)
| Endpoint Type | Low-Speed | Full-Speed | High-Speed |
|---|---|---|---|
| Control (Data Stage) | 8 B | 8, 16, 32, or 64 B | 64 B |
| Bulk | — | 8, 16, 32, or 64 B | 512 B |
| Interrupt | 1–8 B | 1–64 B | 1–1024 B |
| Isochronous | — | 1–1023 B | 1–1024 B |
Transfer Reliability Summary
| Transfer Type | Handshake? | Retries? | Data Toggle? | Error Detection |
|---|---|---|---|---|
| Control | Yes | Yes (3×) | Yes | CRC5 (token) + CRC16 (data) |
| Bulk | Yes | Yes (3×) | Yes | CRC5 + CRC16 |
| Interrupt | Yes | Yes (3×) | Yes | CRC5 + CRC16 |
| Isochronous | No | No | No (uses DATA0 only at FS) | CRC16 only |